import { useLocalStore } from 'mobx-react-lite';

export default function useStore() {
  return useLocalStore(() => ({
    navBounds: {},
    setNavBounds(data:any) {
      this.navBounds = data;
    },
    get getNavBounds() {
      return this.navBounds;
    },
    fresh: {},
    setFresh(data:boolean) {
      this.fresh = !data;
    },
    get getFresh() {
      return this.fresh;
    },
    selectedMenu: undefined,
    setSelectedMenu(data:object) {
      this.selectedMenu = data;
    },
    get getSelectedMenu() {
      return this.selectedMenu;
    },
    selectedHost: {},
    setSelectedHost(data: object) {
      this.selectedHost = data;
    },
    get getSelectedHost() {
      return this.selectedHost;
    },

    disConnectCommand: '',
    setDisConnectCommand(data: string) {
      this.disConnectCommand = data;
    },
    get getDisConnectCommand() {
      return this.disConnectCommand;
    },
  }));
}

export type StoreProps = ReturnType<typeof useStore>;
